import Vue from 'vue'
import Router from 'vue-router'
import Layout from './views/Layout.vue'
import Home from './views/Home'
import RootMain from './components/RootMain'
import Setting from './components/setting/Setting'
import Help from './components/help/Help'
import Actions from './components/actions/Actions'
import Users from './components/users/Users'
import Login from './views/Login'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'layout',
      components:{app_rv:Layout},
        children:[
            {
                path: '',
                name: 'home',
                components:{layout_rv:Home},
                children:[
                    {
                        path: '',
                        name: '',
                        components:{home_main_rv:RootMain},
                    },
                    {
                        path: 'home',
                        name: 'home',
                        components:{home_main_rv:RootMain},
                    },
                    {
                        path: 'actions',
                        name: 'actions',
                        components:{home_main_rv:Actions},
                    },
                    {
                        path: 'users',
                        name: 'users',
                        components:{home_main_rv:Users},
                    },
                    {
                        path: 'reports',
                        name: 'reports',
                        components:{home_main_rv:RootMain},
                    },
                    {
                        path: 'setting',
                        name: 'setting',
                        components:{home_main_rv:Setting},
                    },
                    {
                        path: 'help',
                        name: 'help',
                        components:{home_main_rv:Help},
                    },
                ]
            }
        ]
    },
    {
          path: '/about',
          name: 'about',
          // route level code-splitting
          // this generates a separate chunk (about.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
      },
      {
          path: '/login',
          name: 'login',
          // route level code-splitting
          // this generates a separate chunk (about.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          components:{app_rv:Login},
      }
  ]
})
